package com.changgou.search.controller;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import com.changgou.search.service.EsManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/manager")
@RestController
public class EsManagerController {
    @Autowired
    private EsManagerService esManagerService;
@RequestMapping("/create")
    public Result create(){
        esManagerService.creatIndexAndMapping();
        return  new Result(true, StatusCode.OK,"创建成功");
    }
    @RequestMapping("/importAll")
    public Result importAll(){
        esManagerService.importAll();
        return  new Result(true, StatusCode.OK,"创建成功");
    }

}
